package cn.zjyj.module.zjyj.dal.mysql.riskassessmentdetail;

import cn.zjyj.framework.common.common.pojo.PageResult;
import cn.zjyj.framework.datasource.mybatis.core.query.LambdaQueryWrapperX;
import cn.zjyj.framework.datasource.mybatis.core.mapper.BaseMapperX;
import cn.zjyj.module.zjyj.dal.dataobject.riskassessmentdetail.RiskAssessmentDetailDO;
import org.apache.ibatis.annotations.Mapper;
import cn.zjyj.module.zjyj.controller.admin.riskassessmentdetail.vo.*;

/**
 * 风险评估备份 Mapper
 *
 * @author 超级管理员
 */
@Mapper
public interface RiskAssessmentDetailMapper extends BaseMapperX<RiskAssessmentDetailDO> {

    default PageResult<RiskAssessmentDetailDO> selectPage(RiskAssessmentDetailPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<RiskAssessmentDetailDO>()
                .betweenIfPresent(RiskAssessmentDetailDO::getCreateTime, reqVO.getCreateTime())
                .eqIfPresent(RiskAssessmentDetailDO::getIdentifyId, reqVO.getIdentifyId())
                .eqIfPresent(RiskAssessmentDetailDO::getApplyRecordId, reqVO.getApplyRecordId())
                .eqIfPresent(RiskAssessmentDetailDO::getIdentifyObjectId, reqVO.getIdentifyObjectId())
                .likeIfPresent(RiskAssessmentDetailDO::getIdentifyObjectName, reqVO.getIdentifyObjectName())
                .eqIfPresent(RiskAssessmentDetailDO::getIdentifyObjectContentId, reqVO.getIdentifyObjectContentId())
                .eqIfPresent(RiskAssessmentDetailDO::getRiskType, reqVO.getRiskType())
                .eqIfPresent(RiskAssessmentDetailDO::getIdentifyContentCode, reqVO.getIdentifyContentCode())
                .eqIfPresent(RiskAssessmentDetailDO::getIdentifyContent, reqVO.getIdentifyContent())
                .eqIfPresent(RiskAssessmentDetailDO::getHazard, reqVO.getHazard())
                .eqIfPresent(RiskAssessmentDetailDO::getProjectSolution, reqVO.getProjectSolution())
                .eqIfPresent(RiskAssessmentDetailDO::getManagerSolution, reqVO.getManagerSolution())
                .eqIfPresent(RiskAssessmentDetailDO::getSelfSolution, reqVO.getSelfSolution())
                .eqIfPresent(RiskAssessmentDetailDO::getTrainEduSolution, reqVO.getTrainEduSolution())
                .eqIfPresent(RiskAssessmentDetailDO::getBadSolution, reqVO.getBadSolution())
                .eqIfPresent(RiskAssessmentDetailDO::getInstanceSize, reqVO.getInstanceSize())
                .orderByDesc(RiskAssessmentDetailDO::getId));
    }

}